<!--
 * @Author: your name
 * @Date: 2019-12-23 14:59:30
 * @LastEditTime: 2020-05-27 18:51:40
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vue-admin-template\src\views\print-material-application\index.vue
 -->
<template>
  <div class="app-container">
    <el-card class="tableset" shadow="never" :body-style="{ padding: '0px' }">
      <div>
        <span class="title">打印耗材申请管理</span>
        <!-- <el-button type="success" class="title-button-right" icon="el-icon-delete" plain>已补充</el-button>
        <el-button type="primary" class="title-button-right" icon="el-icon-plus" plain>已采购</el-button>-->
        <el-button
          type="primary"
          class="title-button-right"
          icon="el-icon-plus"
          plain
          @click="consumableApplicationDialog = true"
        >新增耗材申请</el-button>
      </div>
      <!-- <div class="funtion">
        <el-input
          placeholder="请输入内容"
          class="input-with-select"
          @keyup.enter.native="getAdminUserInfoList"
        > -->
      <!-- <el-select slot="prepend" placeholder="请选择" class="option"> -->
      <!-- <el-option label="品牌" value="0" />
            <el-option label="型号" value="1" />
            <el-option label="区域" value="2" />
            <el-option label="申请负责人" value="3" />
          <el-option label="备注" value="4" />-->
      <!-- </el-select> -->
      <!-- <el-button slot="append" icon="el-icon-search" />
        </el-input>
      </div> -->
      <!-- 搜索关键词 -->
      <div class="funtion">
        <el-input
          v-model="get_consumable_apply_info_list.keyword"
          placeholder="请输入关键词"
          class="input-with-select"
          clearable
          @keyup.enter.native="getConsumableApplyInfoList"
        >
          <el-select
            slot="prepend"
            v-model="get_consumable_apply_info_list.keywordType"
            placeholder="请选择"
            class="option"
          >
            <el-option label="负责人名称" value="0" />
          </el-select>
          <el-button slot="append" icon="el-icon-search" @click="getConsumableApplyInfoList" />
        </el-input>
      </div>
      <!-- 搜索关键词 -->

      <!-- 数据表 -->
      <el-table
        v-loading="dataRequestLoading"
        element-loading-text="正在加载中"
        element-loading-spinner="el-icon-loading"
        element-loading-background="rgba(255, 255, 255, 0.5)"
        :data="data_consumable_apply_info_list.data"
        class="table"
        highlight-current-row
        stripe
        style="width: 100%;"
        :height="tableHeight"
        :max-height="tableHeight"
        @sort-change="changeSort"
        @filter-change="changefilter"
      >
        <el-table-column type="selection" width="55" />
        <el-table-column
          prop="area_name"
          :filters="data_consumable_apply_info_list.filterArea"
          :filter-multiple="false"
          column-key="filterArea"
          label="所在区域名称"
        />
        <el-table-column prop="admin_user_name" label="负责人名称" />
        <el-table-column prop="apply_remark" label="申请备注" />
        <el-table-column
          :filters="statusTextShow"
          :filter-multiple="false"
          column-key="filterStatus"
          label="申请状态"
        >
          <template slot-scope="{ row }">
            <span>{{ status_text(row.status) }}</span>
          </template>
        </el-table-column>
        <el-table-column
          prop="brand_model_number"
          :filters="data_consumable_apply_info_list.filterPrinter"
          :filter-multiple="false"
          column-key="filterPrinter"
          label="打印机品牌型号"
        />
        <el-table-column prop="check_remark" label="审核备注" />
        <el-table-column prop="create_time" label="创建时间" sortable="custom" column-key="create_time" />
        <el-table-column fixed="right" label="操作" width="175px">
          <template slot-scope="{ row }">
            <el-button
              type="primary"
              @click="openConsumableApplyStatus(row)"
            >编辑</el-button>
            <el-button
              type="success"
              @click="getConsumableProcurement(row.consumable_apply_id)"
            >采购单</el-button>
          </template>
        </el-table-column>
      </el-table>
      <!-- 数据表 -->

      <!-- 分页 -->
      <el-pagination
        class="pagination"
        background
        layout="total, sizes,prev, pager, next, jumper"
        :total="data_consumable_apply_info_list.total"
        :page-size="get_consumable_apply_info_list.pageSize"
        :page-sizes="[20, 50, 100]"
        :current-page="get_consumable_apply_info_list.currentPage"
        @size-change="changePageSize"
        @current-change="changeCurrentPage"
      />
      <!-- 分页 -->
    </el-card>

    <!-- 新增耗材申请Dialog -->
    <el-dialog
      title="新增耗材申请"
      :visible.sync="consumableApplicationDialog"
      width="800px"
      :close-on-click-modal="false"
      append-to-body
    >
      <el-form
        ref="consumableApplicationForm"
        :model="add_consumable_apply"
        status-icon
        size="mini"
        label-width="130px"
      >
        <el-form-item label="新增耗材列表">
          <template>
            <el-button type="primary" icon="el-icon-plus" size="mini" @click="localAddresponseNum" />
          </template>
        </el-form-item>
        <el-form-item
          v-for="(item, index) in add_consumable_apply.consumable_item"
          :key="item.id"
          :prop="`consumable_item[${add_consumable_apply.consumable_item.length - 1}].number`"
          :rules="rules.select"
          :label="`申请耗材${index + 1}`"
        >
          <el-row :gutter="10">
            <el-col :span="7">
              <el-select v-model="item.type" placeholder="请选择">
                <el-option
                  v-for="option in consumableType"
                  :key="option.value"
                  :label="option.value"
                  :value="option.value"
                />
              </el-select>
            </el-col>
            <el-col :span="7">
              <el-select v-if="item.type === '纸张'" v-model="item.name" placeholder="请选择纸张类型">
                <el-option
                  v-for="(option, index) in paperType"
                  :key="index"
                  :label="option.value"
                  :value="option.value"
                />
              </el-select>
              <el-select v-if="item.type === '墨水'" v-model="item.name" placeholder="请选择墨水">
                <el-option
                  v-for="(option, index) in inkType"
                  :key="index"
                  :label="option.value"
                  :value="option.value"
                />
              </el-select>
              <el-select v-if="item.type === '打印头'" v-model="item.name" placeholder="请选择打印头类型">
                <el-option
                  v-for="(option, index) in printHead"
                  :key="index"
                  :label="option.value"
                  :value="option.value"
                />
              </el-select>
            </el-col>
            <el-col :span="7">
              <el-input v-model="item.number" type="number" placeholder="请输入数量" clearable />
            </el-col>
            <el-col :span="2">
              <el-button
                type="danger"
                icon="el-icon-delete"
                size="mini"
                @click="localDeleteresponseNum(item)"
              />
            </el-col>
          </el-row>
        </el-form-item>
        <el-form-item prop="printer_id" :rules="rules.select" label="打印机品牌及型号">
          <el-select v-model="add_consumable_apply.printer_id" placeholder="请选择">
            <el-option
              v-for="option in data_consumable_apply_info_list.filterPrinter"
              :key="option.value"
              :rules="rules.select"
              :label="option.text"
              :value="option.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item prop="apply_remark" :rules="rules.input" label="申请备注">
          <el-input
            v-model="add_consumable_apply.apply_remark"
            type="textarea"
            placeholder="请输入申请备注"
            clearable
          />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button size="mini" @click="consumableApplicationDialog = false">取 消</el-button>
        <el-button size="mini" type="primary" @click="adminUserAddConsumableApply">保 存</el-button>
      </span>
    </el-dialog>
    <!-- 新增耗材申请Dialog -->
    <!-- 审核备注Dialog -->
    <!-- <el-dialog
      title="编辑"
      :visible.sync="reviewRemarkDialog"
      width="500px"
      :close-on-click-modal="false"
      append-to-body
    >
      <el-form status-icon size="mini" label-width="80px">
        <el-form-item label="备注">
          <el-input type="textarea" placeholder="请输入操作备注" clearable />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button size="mini" @click="reviewRemarkDialog = false">取 消</el-button>
        <el-button size="mini" type="primary">保 存</el-button>
      </span>
    </el-dialog> -->
    <!-- 审核备注Dialog -->
    <el-dialog
      title="修改耗材申请状态"
      :visible.sync="reviewRemarkDialog"
      width="500px"
      :close-on-click-modal="false"
      append-to-body
    >
      <el-form ref="reviewRemarkForm" :model="change_consumable_apply_status" status-icon size="mini" label-width="80px">
        <el-form-item prop="status" :rules="rules.select" label="修改状态">
          <el-select v-model="change_consumable_apply_status.status" placeholder="请选择耗材申请状态">
            <el-option
              v-for="item in statusTextShow"
              :key="item.value"
              :label="item.text"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item prop="check_remark" label="审核备注" :rules="rules.input">
          <el-input v-model="change_consumable_apply_status.check_remark" type="textarea" placeholder="请输入操作备注" clearable />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button size="mini" @click="changeStatusDialog=false">取 消</el-button>
        <el-button size="mini" type="primary" @click="changeConsumableApplyStatus">保 存</el-button>
      </span>
    </el-dialog>
    <!-- 采购单Dialog -->
    <el-dialog
      title="采购单"
      :visible.sync="purchaseOrderDialog"
      width="1200px"
      :close-on-click-modal="false"
      append-to-body
    >
      <el-table
        ref="xtable"
        v-loading="dialogDataRequestLoading"
        element-loading-text="正在加载中"
        element-loading-spinner="el-icon-loading"
        element-loading-background="rgba(255, 255, 255, 0.5)"
        :data="data_consumable_procurement.data"
        class="tb-edit"
        :highlight-current-row="select_row"
        :height="tableHeight"
        :max-height="tableHeight"
        @sort-change="changeDialogSort"
        @filter-change="changeDialogFilter"
        @row-click="rowClick"
        @current-change="rowEdit"
      >
        <el-table-column label="耗材类型">
          <template scope="{ row }">
            <!-- <el-input v-if="row.edit" v-model="row.consumable_type" size="small" placeholder="请输入内容" @click.stop.native="" />
            <span v-else>{{ row.consumable_type }}</span> -->
            <el-select v-if="row.edit" v-model="row.consumable_type" size="small" placeholder="请选择耗材类型" @click.stop.native="">
              <el-option
                v-for="item in consumableType"
                :key="item.value"
                :label="item.text"
                :value="item.value"
              />
            </el-select>
            <span v-else>{{ row.consumable_type }}</span>
          </template>
        </el-table-column>
        <el-table-column label="耗材品名">
          <template scope="{ row }">
            <el-select v-if="row.edit" v-model="row.consumable_name" size="small" placeholder="请选择耗材品名" @click.stop.native="">
              <el-option
                v-for="item in paperType"
                :key="item.value"
                :label="item.text"
                :value="item.value"
              />
            </el-select>
            <span v-else>{{ row.consumable_name }}</span>
          </template>
        </el-table-column>
        <el-table-column
          :filters="typeTextShow"
          :filter-multiple="false"
          column-key="filterType"
          label="采购单类型"
        >
          <template slot-scope="{ row }">
            <!-- <span>{{ type_text(row.type) }}</span> -->
            <el-select v-if="row.edit" v-model="row.type" size="small" placeholder="请选择采购单类型" @click.stop.native="">
              <el-option
                v-for="item in typeTextShow"
                :key="item.value"
                :label="item.text"
                :value="item.value"
              />
            </el-select>
            <span v-else>{{ type_text(row.type) }}</span>
          </template>
        </el-table-column>
        <el-table-column label="订单编号">
          <template scope="{ row }">
            <el-input v-if="row.edit" v-model="row.order_number" size="small" placeholder="请输入内容" @click.stop.native="" />
            <span v-else>{{ row.order_number }}</span>
          </template>
        </el-table-column>
        <el-table-column label="价格">
          <template scope="{ row }">
            <el-input v-if="row.edit" v-model="row.price" size="small" placeholder="请输入内容" @click.stop.native="" />
            <span v-else>{{ row.price }}</span>
          </template>
        </el-table-column>
        <el-table-column label="数量">
          <template scope="{ row }">
            <el-input v-if="row.edit" v-model="row.num" size="small" placeholder="请输入内容" @click.stop.native="" />
            <span v-else>{{ row.num }}</span>
          </template>
        </el-table-column>
        <el-table-column label="快递单号">
          <template scope="{ row }">
            <el-input v-if="row.edit" v-model="row.tracking_number" size="small" placeholder="请输入内容" @click.stop.native="" />
            <span v-else>{{ row.tracking_number }}</span>
          </template>
        </el-table-column>
        <!-- <el-table-column prop="status" label="采购单状态" /> -->
        <el-table-column
          :filters="purchaseStatusTextShow"
          :filter-multiple="false"
          column-key="filterStatus"
          label="采购单状态"
        >
          <template slot-scope="{ row }">
            <el-select v-if="row.edit" v-model="row.status" size="small" placeholder="请选择采购单状态" @click.stop.native="">
              <el-option
                v-for="item in purchaseStatusTextShow"
                :key="item.value"
                :label="item.text"
                :value="item.value"
              />
            </el-select>
            <span v-else>{{ purchasesStatus_text(row.status) }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="create_time" label="创建时间" sortable="custom" column-key="create_time" />
      </el-table>
      <span slot="footer" class="dialog-footer">
        <el-button size="mini" @click="purchaseOrderDialog = false">取 消</el-button>
        <el-button size="mini" type="primary" @click="changeConsumableProcurementInfo">保 存</el-button>
      </span>
    </el-dialog>
    <!-- 采购单Dialog -->
  </div>
</template>

<script>
import { getConsumableApplyInfoList, adminUserAddConsumableApply, getConsumableProcurement, changeConsumableApplyStatus, changeConsumableProcurementInfo } from '@/api/print-material-application'
export default {
  name: 'Index',
  data() {
    return {
      // table高度自适应
      tableHeight: window.innerHeight - 265,

      // loading开关
      dataRequestLoading: false,
      dialogDataRequestLoading: false,

      // 耗材类型选择框
      consumableType: [
        { value: '纸张' },
        { value: '墨水' },
        { value: '打印头' }
      ],
      // 申请状态Text显示
      statusTextShow: [
        { text: '待审批', value: 0 },
        { text: '已审批', value: 1 },
        { text: '已采购', value: 2 },
        { text: '已发货', value: 3 },
        { text: '已补充', value: 4 },
        { text: '申请取消', value: 5 }
      ],
      // 采购单类型Text显示
      typeTextShow: [
        { text: '仓库', value: 0 },
        { text: '天猫', value: 1 },
        { text: '淘宝', value: 2 },
        { text: '一淘', value: 3 },
        { text: '阿里巴巴', value: 4 },
        { text: '京东', value: 5 },
        { text: '拼多多', value: 6 },
        { text: '苏宁易购', value: 7 },
        { text: '当当', value: 8 },
        { text: '其他平台', value: 9 }
      ],
      // 采购单状态Text显示
      purchaseStatusTextShow: [
        { text: '待下单', value: 0 },
        { text: '已下单', value: 1 },
        { text: '已发货', value: 2 },
        { text: '已签收', value: 3 },
        { text: '已退货', value: 4 }
      ],
      // 耗材品名选择框
      paperType: [
        { value: 'A4打印纸' },
        { value: '6寸相纸' }
      ],
      // 墨水选择框
      inkType: [
        { value: 'GI-80PGBK（黑）' },
        { value: 'GI-80C（蓝）' },
        { value: 'GI-80M（红）' },
        { value: 'GI-80Y（黄）' }
      ],

      // 打印头类型选择框
      printHead: [
        { value: 'Black打印头' },
        { value: 'Color打印头' }
      ],
      status: '',
      // dialog开关
      reviewRemarkDialog: false, // 编辑审核备注
      consumableApplicationDialog: false, // 新增打印耗材申请
      purchaseOrderDialog: false, // 查看采購單詳情

      // 发送查询请求参数
      get_consumable_apply_info_list: {
        pageSize: 20,
        currentPage: 1,
        keyword: '',
        keywordType: '0',
        sort_name: '',
        sort: 'desc',
        filterAreaId: '',
        filterPrinterId: '',
        filterStatus: ''
      },
      // 查询返回值参数
      data_consumable_apply_info_list: {
        data: [],
        filterArea: [],
        filterPrinter: [],
        total: 0
      },
      // 新增耗材申请参数
      add_consumable_apply: {
        printer_id: '',
        apply_remark: '',
        consumable_item: []
      },
      // 修改申请耗材状态参数
      change_consumable_apply_status: {
        consumable_apply_id: '',
        status: '',
        check_remark: ''
      },
      // 表单校验规则
      rules: {
        input: { required: true, message: '请完成输入！', trigger: 'blur' },
        select: { required: true, message: '请完成选择！', trigger: 'blur' }
      },
      // 查询采购信息发送请求参数
      get_consumable_procurement: {
        consumable_apply_id: '',
        sort_name: '',
        sort: '',
        filterType: '',
        filterStatus: ''
      },
      // 查询采购信息返回参数
      data_consumable_procurement: {
        data: [],
        total: 0
      },
      select_row: false
    }
  },
  mounted() {
    this.getConsumableApplyInfoList() // 查询微信用户信息列表
  },
  methods: {
    // 行内编辑
    rowClick(row) {
      row.edit = !row.edit
      this.select_row = row.edit
    },
    rowEdit(currentRow, oldCurrentRow) {
      if (oldCurrentRow !== null) {
        oldCurrentRow.edit = false
      }
    },

    // 查询耗材信息列表
    getConsumableApplyInfoList() {
      this.dataRequestLoading = true
      getConsumableApplyInfoList(this.get_consumable_apply_info_list).then(res => {
        this.data_consumable_apply_info_list.data = res.result.showing
        this.data_consumable_apply_info_list.filterArea = res.result.filterArea
        this.data_consumable_apply_info_list.filterPrinter = res.result.filterPrinter
        this.data_consumable_apply_info_list.total = res.result.total
        this.dataRequestLoading = false
      })
    },
    // 打开编辑修改耗材状态及备注
    openConsumableApplyStatus(row) {
      this.reviewRemarkDialog = true
      this.change_consumable_apply_status.consumable_apply_id = row.consumable_apply_id
    },
    // 修改耗材状态及备注
    changeConsumableApplyStatus() {
      this.$refs.reviewRemarkForm.validate(valid => {
        if (valid) {
          changeConsumableApplyStatus(this.change_consumable_apply_status).then(res => {
            this.change_consumable_apply_status = {
              consumable_apply_id: '',
              status: '',
              check_remark: ''
            }
            this.getConsumableApplyInfoList()
            this.reviewRemarkDialog = false
            this.$notify({
              title: '成功',
              message: '修改耗材申请成功！',
              type: 'success'
            })
          })
        } else {
          return false
        }
      })
    },
    // 新增耗材申请列表
    localAddresponseNum() {
      const num = this.add_consumable_apply.consumable_item.length
      this.add_consumable_apply.consumable_item.push({
        id: num + 1,
        type: '',
        name: '',
        number: ''
      })
    },
    // 申请状态显示
    status_text(data) {
      const statusTextShow = this.statusTextShow.filter(v => {
        if (v.value === data) {
          return v.text
        }
      })
      return statusTextShow[0].text
    },
    // 本地删除返回值条数
    localDeleteresponseNum(item) {
      const number = this.add_consumable_apply.consumable_item.indexOf(item)
      this.add_consumable_apply.consumable_item.splice(number, 1)
    },
    // 负责人新增耗材申请
    adminUserAddConsumableApply() {
      this.$refs.consumableApplicationForm.validate(valid => {
        if (valid) {
          adminUserAddConsumableApply(this.add_consumable_apply).then(res => {
            this.add_consumable_apply = {
              printer_id: '',
              apply_remark: '',
              consumable_item: []
            }
            this.getConsumableApplyInfoList()
            this.consumableApplicationDialog = false
            this.$notify({
              title: '成功',
              message: '新增耗材申请成功！',
              type: 'success'
            })
          })
        } else {
          return false
        }
      })
    },
    // 筛选记录者
    changefilter(filters) {
      if (filters.filterArea) {
        if (filters.filterArea.length === 0) {
          this.get_consumable_apply_info_list.filterArea = ''
        } else {
          this.get_consumable_apply_info_list.filterArea = filters.filterArea[0]
        }
      } else if (filters.filterPrinter) {
        if (filters.filterPrinter.length === 0) {
          this.get_consumable_apply_info_list.filterPrinter = ''
        } else {
          this.get_consumable_apply_info_list.filterPrinter = filters.filterPrinter[0]
        }
      } else if (filters.filterStatus) {
        if (filters.filterStatus.length === 0) {
          this.get_consumable_apply_info_list.filterStatus = ''
        } else {
          this.get_consumable_apply_info_list.filterStatus = filters.filterStatus[0]
        }
      }
      this.getConsumableApplyInfoList()
    },
    // 筛选采购单
    changeDialogFilter(filters) {
      if (filters.filterType) {
        if (filters.filterType.length === 0) {
          this.get_consumable_procurement.filterType = ''
        } else {
          this.get_consumable_procurement.filterType = filters.filterType[0]
        }
      } else if (filters.filterStatus) {
        if (filters.filterStatus.length === 0) {
          this.get_consumable_procurement.filterStatus = ''
        } else {
          this.get_consumable_procurement.filterStatus = filters.filterStatus[0]
        }
      }
      this.getConsumableProcurement(this.get_consumable_procurement.consumable_apply_id)
    },
    // 更换打印耗材创建时间排序
    changeSort({ column, order }) {
      switch (order) {
        case 'descending':
          this.get_consumable_apply_info_list.sort_name = 'create_time'
          this.get_consumable_apply_info_list.sort = 'desc'
          this.getConsumableApplyInfoList()
          break
        case 'ascending':
          this.get_consumable_apply_info_list.sort_name = 'create_time'
          this.get_consumable_apply_info_list.sort = 'asc'
          this.getConsumableApplyInfoList()
          break
        default:
          this.get_consumable_apply_info_list.sort_name = ''
          this.get_consumable_apply_info_list.sort = 'desc'
          this.getConsumableApplyInfoList()
      }
    },
    // 更换采购单创建时间排序
    changeDialogSort({ column, order }) {
      switch (order) {
        case 'descending':
          this.get_consumable_procurement.sort_name = 'create_time'
          this.get_consumable_procurement.sort = 'desc'
          this.getConsumableProcurement(this.get_consumable_procurement.consumable_apply_id)
          break
        case 'ascending':
          this.get_consumable_procurement.sort_name = 'create_time'
          this.get_consumable_procurement.sort = 'asc'
          this.getConsumableProcurement(this.get_consumable_procurement.consumable_apply_id)
          break
        default:
          this.get_consumable_procurement.sort_name = ''
          this.get_consumable_procurement.sort = 'desc'
          this.getConsumableProcurement(this.get_consumable_procurement.consumable_apply_id)
      }
    },
    // 切换每页条数方法
    changePageSize(data) {
      this.get_consumable_apply_info_list.pageSize = data
      this.getConsumableApplyInfoList()
    },

    // 切换页码方法
    changeCurrentPage(data) {
      this.get_consumable_apply_info_list.currentPage = data
      this.getConsumableApplyInfoList()
    },
    // 查询采购单信息列表
    getConsumableProcurement(consumable_apply_id) {
      this.dialogDataRequestLoading = true
      this.purchaseOrderDialog = true
      this.get_consumable_procurement.consumable_apply_id = consumable_apply_id
      this.get_consumable_procurement.sort_name = ''
      this.get_consumable_procurement.sort = 'desc'
      getConsumableProcurement(this.get_consumable_procurement).then(
        res => {
          this.dialogDataRequestLoading = false
          this.data_consumable_procurement.data = res.result.showing
          // this.data_consumable_procurement.total = res.result.total
        }
      )
    },

    // 采购单类型显示
    type_text(data) {
      const typeTextShow = this.typeTextShow.filter(v => {
        if (v.value === data) {
          return v.text
        }
      })
      return typeTextShow[0].text
    },
    // 申请状态显示
    purchasesStatus_text(data) {
      const purchaseStatusTextShow = this.purchaseStatusTextShow.filter(v => {
        if (v.value === data) {
          return v.text
        }
      })
      return purchaseStatusTextShow[0].text
    },
    // 修改采购单信息
    changeConsumableProcurementInfo() {
      changeConsumableProcurementInfo({ consumableProcurementJson: this.data_consumable_procurement.data }).then(res => {
        this.getConsumableProcurement(this.get_consumable_procurement.consumable_apply_id)
        this.$notify({
          title: '成功',
          message: '修改采购单成功！',
          type: 'success'
        })
      })
    }
  }
}

</script>

<style lang="scss" scoped>
.delete-button {
  margin-left: 14px;
}
.tb-edit .el-input {
  display: none
}
.tb-edit .current-row .el-input {
  display: block
}
.tb-edit .current-row .el-input+span {
  display: none
}
</style>
